#ifndef __heibai_rule__h__
#define __heibai_rule__h__

#include "heibai_chessboard.h"
#include "heibai_user.h"

#define HEIBAI_END 0

class CHBRule
{
	public:
		CHBRule(CHBChessBoard * board);
		~CHBRule();
		int SetUser(CHBUser * user, int i);
		void GetSig(int &x, int &y);
		int Run();
		int TestPut(int user);
		int GetWinPlayer(){return m_nWinPlayer;}
	protected:
		void GetUserChess(int &x, int &y);
		int PutChess(int x, int y, int user, int bShow = 1);
		int TurnDir(int x, int y, int tx, int ty, int user, int bShow = 1);
		int GetOtherUser(int user);
		int GetNextPlay(int user);
		int CanPlay(int user);
	protected:
		char m_ssChess[10][10];
		CHBChessBoard * m_vBoard;
	private:
		CHBUser * m_user[2];
		int	m_nWinPlayer;
};

#endif

